package com.lmx.web.controller;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lmx.persistence.service.PersonLocationIOReportService;
import com.lmx.persistence.service.PersonLocationReportService;

@Controller
@RequestMapping(value = "/person-location-report")
public class PersonLocationController {
	@Autowired
	private PersonLocationReportService service;
	@Autowired
	private PersonLocationIOReportService ioService;

	@RequestMapping(value = "/start", method = RequestMethod.GET)
	@ResponseBody
	public Boolean sysPersonLocation(@RequestParam Long dateValue) {
		dateValue = dateValue != null ? dateValue : new Date().getTime();
		return this.service.sysLocationReportData(dateValue);
	}

	@RequestMapping(value = "/io", method = RequestMethod.GET)
	@ResponseBody
	public Boolean sysPersonLocationIO(@RequestParam Long dateValue) {
		dateValue = dateValue != null ? dateValue : new Date().getTime();
		this.ioService.sysIOReportData(dateValue);
		return true;
	}
}
